home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / 第1特集Plug-in / Photoshop / Dan's Pascal Plug-In.sit / Dan's Pascal Plug-In / AcquireInterface.p next >
Text File  |  1994-04-24  |  6KB  |  159 lines

  1. (*}
  2. {    File: AcquireInterface.h                }
  3. {}
  4. {    Copyright 1990-91 by Thomas Knoll.            }
  5. {}
  6. {    This file describes version 4.0 of Photoshop's Acquisition module interface.}
  7. (*  Converted 1994-03-05 using Dan's Source Converter         *)
  8. {The code resource and file type for acquisition modules is ヤ8BAMユ.}
  9.  
  10.  
  11. Unit AcquireInterface;
  12.  
  13. Interface
  14.  
  15.     Const
  16.     (* Operation selectors *)
  17.         acquireSelectorAbout = 0;
  18.         acquireSelectorStart = 1;
  19.         acquireSelectorContinue = 2;
  20.         acquireSelectorFinish = 3;
  21.         acquireSelectorPrepare = 4;
  22.  
  23.     (* Image modes *)
  24.         acquireModeBitmap = 0;
  25.         acquireModeGrayScale = 1;
  26.         acquireModeIndexedColor = 2;
  27.         acquireModeRGBColor = 3;
  28.         acquireModeCMYKColor = 4;
  29.         acquireModeHSLColor = 5;
  30.         acquireModeHSBColor = 6;
  31.         acquireModeMultichannel = 7;
  32.         acquireModeDuotone = 8;
  33.  
  34.  
  35.     (* Error return values. The plug-in module may also return standard Macintosh}
  36.     { operating system error codes, or report its own errors, in which case it}
  37.     { can return any positive integer. *)
  38.         acquireBadParameters = -30000;    (* "a problem with the acquisition module interface" *)
  39.         acquireNoScanner = -30001;        (* "there is no scanner installed" *)
  40.         acquireScannerProblem = -30002;    (* "a problem with the scanner" *)
  41.  
  42.     Type
  43.         AcquireLUT = Packed Array[0..255] Of char;
  44.  
  45.         AcquireMap = Array[0..15] Of Integer;
  46.         AcquireRecordPtr = ^AcquireRecord;
  47.  
  48.         AcquireMonitor = Record
  49.                 gamma: Fixed;            (* Gamma value *)
  50.  
  51.                 redX: Fixed;            (* Red phosphor *)
  52.                 redY: Fixed;
  53.  
  54.                 greenX: Fixed;            (* Green phosphor *)
  55.                 greenY: Fixed;
  56.  
  57.                 blueX: Fixed;            (* Blue phosphor *)
  58.                 blueY: Fixed;
  59.  
  60.                 whiteX: Fixed;            (* White point *)
  61.                 whiteY: Fixed;
  62.  
  63.                 ambient: Fixed;            (* 0.0 = Low, 0.5 = Medium, 1.0 = High *)
  64.             End;
  65.  
  66.  
  67.         AcquireRecord = Record
  68.                 serialNumber: LongInt;        (* Host's serial number, to allow}
  69. {                    copy protected plug-in modules. *)
  70.  
  71.                 abortProc: ProcPtr;        (* The plug-in module may call this no-argument}
  72. {                    BOOLEAN function (using Pascal calling}
  73. {                    conventions) several times a second during long}
  74. {                    operations to allow the user to abort the operation.}
  75. {                    If it returns TRUE, the operation should be aborted}
  76. {                    (and a positive error code returned). *)
  77.  
  78.                 progressProc: ProcPtr;        (* The plug-in module may call this two-argument}
  79. {                    procedure (using Pascal calling conventions)}
  80. {                    periodically to update a progress indicator.}
  81. {                    The first parameter (type LONGINT) is the number}
  82. {                    of operations completed; the second (type LONGINT)}
  83. {                    is the total number of operations. *)
  84.  
  85.                 maxData: LongInt;        (* Maximum number of bytes that should be}
  86. {                    passed back at once, plus the size of any}
  87. {                    interal buffers. The plug-in may reduce this}
  88. {                    value in the acquireSelectorPrepare routine. *)
  89.  
  90.                 imageMode: Integer;        (* Image mode *)
  91.                 imageSize: Point;        (* Size of image *)
  92.                 depth: Integer;            (* Bits per sample, currently must be 1 or 8 *)
  93.                 planes: Integer;         (* Samples per pixel *)
  94.  
  95.                 imageHRes: Fixed;        (* Horizontal Pixels per inch *)
  96.                 imageVRes: Fixed;        (* Vertical Pixels per inch *)
  97.  
  98.                 redLUT: AcquireLUT;         (* Red LUT, only used for Indexed Color images *)
  99.                 greenLUT: AcquireLUT;        (* Green LUT, only used for Indexed Color images *)
  100.                 blueLUT: AcquireLUT;        (* Blue LUT, only used for Indexed Color images *)
  101.  
  102.                 data: Ptr;            (* A pointer to the returned image data. The}
  103. {                    plug-in module is now responsible for freeing}
  104. {                    this buffer (this is a change from previous}
  105. {                    versions). Should be set to NIL when}
  106. {                    all the image data has been returned. *)
  107.  
  108.                 theRect: Rect;            (* Rectangle being returned *)
  109.                 loPlane: Integer;        (* First plane being returned *)
  110.                 hiPlane: Integer;        (* Last plane being returned *)
  111.                 colBytes: Integer;        (* Spacing between columns *)
  112.                 rowBytes: LongInt;        (* Spacing between rows *)
  113.                 planeBytes: LongInt;         (* Spacing between planes (ignored if only one}
  114. {                    plane is returned at a time) *)
  115.  
  116.                 filename: Str255;        (* Document file name *)
  117.                 vRefNum: Integer;        (* Volume reference number, or zero if none *)
  118.                 dirty: Boolean;            (* Changes since last saved flag. The plug-in may clear}
  119. {                    this field to prevent prompting the user when}
  120. {                    closing the document. *)
  121.  
  122.                 hostSig: OSType;        (* Creator code for host application *)
  123.                 hostProc: ProcPtr;        (* Host specific callback procedure *)
  124.  
  125.                 hostModes: LongInt;        (* Used by the host to inform the plug-in which}
  126. {                    imageMode values it supports.  If the corresponding}
  127. {                    bit (LSB = bit 0) is 1, the mode is supported. *)
  128.  
  129.                 planeMap: AcquireMap;        (* Maps plug-in plane numbers to host plane}
  130. {                    numbers.  The host initializes this is a linear}
  131. {                    mapping.  The plug-in may change this mapping if}
  132. {                    it sees the data in a different order. *)
  133.  
  134.                 canTranspose: Boolean;        (* Is the host able to transpose the image? *)
  135.                 needTranspose: Boolean;        (* Does the plug-in need the image transposed? *)
  136.  
  137.                 duotoneInfo: Handle;        (* Handle to duotone information, if returning a}
  138. {                    duotone mode image.  The plug-in is responsible}
  139. {                    for freeing this buffer. *)
  140.  
  141.                 diskSpace: LongInt;        (* Free disk space on the host's scratch disk or}
  142. {                    disks.  Set to a negative number if host does}
  143. {                    not use a scratch disk. *)
  144.  
  145.                 spaceProc: ProcPtr;    { If not NIL, a pointer to a no-argument}
  146. {                LONGINT function (using Pascal calling}
  147. {                conventions) which uses the current settings of}
  148. {                the imageMode, imageSize, depth, and planes}
  149. {                fields to compute the amount of scratch disk}
  150. {                space required to hold the image.  Returns -1}
  151. {                if the settings are not valid. }
  152.  
  153.                 monitor: AcquireMonitor;    (* Information on current monitor *)
  154.  
  155.                 reserved: Packed Array[0..255] Of char;(* Set to zero *)
  156.             End;
  157.  
  158. Implementation
  159. End.